package com.lry.basic.algorithm.stack;

import java.util.Arrays;

/**
 * @author:刘仁有
 * @desc:
 * @email:953506233@qq.com
 * @data:2019/12/6
 */
public class TopK {
    public static void main(String[] args) {
        System.out.println(findKthLargest(new int[]{1,3,2,4},2));
    }
    //搞笑解法
    public static int findKthLargest(int[] nums, int k) {
        Arrays.sort(nums);

        return nums[nums.length-k];
    }


}
